﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace YammerWM6
{
    class Program
    {
        public static RegistryTokenStorage TokenStorage = new RegistryTokenStorage();

        #region private static void Main(string[] args)

        /// <summary>
        /// Defines the program entry point.
        /// </summary>
        /// <param name="args">A <see cref="T:System.String"/> array containing any command line arguments specified at runtime.</param>
        private static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomainUnhandledException);
            Application.Run(new frmMessages());
        }

        #endregion

        #region private static void CurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)

        /// <summary>
        /// Handles the <see cref="M:System.AppDomain.UnhandledException"/> event of the current <see cref="T:System.AppDomain"/>.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.UnhandledExceptionEventArgs"/> instance containing the event data.</param>
        private static void CurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            Exception ex = e.ExceptionObject as Exception;

            if (ex != null)
            {
                MessageBox.Show(ex.Message);
            }
        }

        #endregion

    }
}
